package cc.yiueil.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class ResultVo {
    private int code;
    private String msg;
    private Object data;

    public ResultVo(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public static ResultVo ok(int code, String msg, Object data) {
        return new ResultVo(200, msg, data);
    }

    public static ResultVo fail(int code, String msg) {
        return new ResultVo(500, msg);
    }
}
